package com.catchu.pattern.creational.命令模式.invoker;

import com.catchu.pattern.creational.命令模式.command.BaseCommand;

/**
 * 调用者，持有command
 */
public class Invoker {

    private BaseCommand baseCommand;

    public void setBaseCommand(BaseCommand baseCommand) {
        this.baseCommand = baseCommand;
    }

    /**
     * 实际执行的行为方法
     */
    public void action(){
        this.baseCommand.execute();
    }
}
